<template>
	<div class="message-panel">
		<div class="smdt-set-item">
			<div>左边距(px)</div>
			<input type="text" class="set-input" />
		</div>

		<div class="smdt-set-item">
			<div>上边距(px)</div>
			<input type="text" class="set-input" />
		</div>

		<div class="smdt-set-item">
			<div>宽度(px)</div>
			<input type="text" class="set-input" v-model="imageWidth" @blur="blurWidthInput"/>
			<div class="errorFontSize" v-if='imageWidthErrorShow'>可输入范围：10 ~ 1920</div>
		</div>

		<div class="smdt-set-item">
			<div>高度(px)</div>
			<input type="text" class="set-input" />
		</div>
		<hr/>
		<div class="smdt-set-btn-area">
			<div class="smdt-set-btn-areaIcon smdt-set-btn-areaIconPosi1"></div>
			<div class="smdt-set-btn-areaIcon smdt-set-btn-areaIconPosi2"></div>
			<div class="smdt-set-btn-areaIcon smdt-set-btn-areaIconPosi3"></div>
			<div class="smdt-set-btn-areaIcon smdt-set-btn-areaIconPosi4"></div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				imageWidth: '',
				imageWidthErrorShow:false
			}
		},
		methods:{
			blurWidthInput(){
				if(this.imageWidth>1920){
					this.imageWidthErrorShow=true;
				}
			}
		}

	}
</script>

<style scoped>
    hr{
        width: calc( 100% - 30px );
        margin-left:15px;
    }
	.errorFontSize {
		color: #ed4014;
		font-size: 12px;
		margin-top: 4px;
	}

	.smdt-set-btn-areaIconPosi1 {
		background-position: -20px -20px;
	}

	.smdt-set-btn-areaIconPosi2 {
		background-position: -46px -20px;
	}

	.smdt-set-btn-areaIconPosi3 {
		background-position: -72px -20px;
	}

	.smdt-set-btn-areaIconPosi4 {
		background-position: -98px -20px;
	}

	.smdt-set-btn-areaIcon {
		width: 30px;
		height: 30px;
		padding: 5px;
		background-image: url(../../../assets/img/icon_editor.png);
		background-repeat: no-repeat;
		background-origin: content-box;
		border: 1px solid transparent;
		vertical-align: middle;
		cursor: pointer;
	}

	.smdt-set-btn-area {
		display: flex;
        padding: 0px 15px;
		justify-content: flex-start;
		align-items: center;
	}

	.message-panel {
		width: 100%;
		height: auto;
		background-color: #f4f4f4;
	}

	.smdt-set-item {
		box-sizing: border-box;
		padding: 10px 15px;
		font-size: 12px;
	}

	.set-input {
		box-sizing: border-box;
		margin-top: 10px;
		width: 234px;
		height: 30px;
		line-height: 30px;
		text-indent: 6px;
		color: #4c4c4c;
		border: 1px solid #b9b9b9;
		background-color: #fff;
		overflow: hidden;
	}
</style>
